/*****************************************************************************
 * Copyright (c) 2010 -, Anders All rights reserved
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *  Contact: Anders Uddenberg (anders.uddenberg@gmail.com)
 * 
 *
 ****************************************************************************/
package org.easypr.organizer.client.event;

import java.util.ArrayList;

import org.easypr.organizer.shared.MyContact;
import org.easypr.organizer.shared.MyUser;

import com.google.gwt.event.shared.GwtEvent;

// TODO: Auto-generated Javadoc
/**
 * The Class DisplaySearchResultEvent.
 */
public class DisplaySearchResultEvent extends GwtEvent<DisplaySearchResultEventHandler>{

	/** The TYPE. */
	public static Type<DisplaySearchResultEventHandler> TYPE = new Type<DisplaySearchResultEventHandler>();
	
	/** The contacts. */
	private ArrayList<MyContact> contacts;
	
	/** The user. */
	private MyUser user;
	
	/**
	 * Instantiates a new display search result event.
	 *
	 * @param contacts the contacts
	 * @param user the user
	 */
	public DisplaySearchResultEvent(ArrayList<MyContact> contacts, MyUser user) {
		this.contacts = contacts;
		this.user = user;
	}
	
	/**
	 * Gets the user.
	 *
	 * @return the user
	 */
	public MyUser getUser() {
		return this.user;
	}
	
	/**
	 * Gets the contacts.
	 *
	 * @return the contacts
	 */
	public ArrayList<MyContact> getContacts() {
		return this.contacts;
	}
	
	
	/* (non-Javadoc)
	 * @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
	 */
	@Override
	protected void dispatch(DisplaySearchResultEventHandler handler) {
		handler.onDisplaySearchResult(this);
	}

	/* (non-Javadoc)
	 * @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
	 */
	@Override
	public Type<DisplaySearchResultEventHandler> getAssociatedType() {
		return TYPE;
	}
	
}
